package com.weige.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@MapperScan("com.weige.order.mapper")
@SpringBootApplication
//@EnableFeignClients(clients = {UserClient.class})
//@EnableFeignClients(basePackages = "com.weige.api.client") //  开启Feign的功能支持
public class OrderApplication {

    public static void main(String[] args) {
        SpringApplication.run(OrderApplication.class, args);
    }

    /**
     * 定义远程访问的http模板对象
     */
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    /**
     * 定义ribbon负载均衡策略bean对象
     */
    //@Bean
    //public IRule iRule() {
    //    return new RandomRule();
    //}
}